<template>
  <div class="car-custom-wrap">
    <FormPanel ref="carRemarkFormPanel" :list="carRemarkFormList" :cols="1" :labelWidth="110" :isSubmitBtn="false" @formChange="formChangeHandle" />
  </div>
</template>

<script>
export default {
  name: 'Carremark',
  props: ['protectRepairInfo'],
  data() {
    return {
      carRemarkFormList: this.createCarRemarkFormList()
    };
  },
  mounted() {
    this.protectRepairFun();
  },
  methods: {
    createCarRemarkFormList() {
      return [
        {
          type: 'TEXT_AREA',
          label: '备注',
          fieldName: 'REMARK',
          // style: {width: '100vh'},
          placeholder: '请输入...',
          change: val => {
            this.$refs.carRemarkFormPanel.SUBMIT_FORM();
          }
          // disabled: true,
          // rules: [{ required: false, message: '请输入品牌名称', trigger: 'blur' }]
        }
      ];
    },
    formChangeHandle(val) {
      this.$emit('remarkChangeHandle', val);
    },
    protectRepairFun() {
      this.carRemarkFormList.forEach(x => {
        x.initialValue = this.protectRepairInfo[x.fieldName];
      });
    }
  }
};
</script>

<style lang="less">
.car-custom-wrap {
  height: calc(100vh - 175px);
}
</style>
